(function(doc,win){
    var docEl = doc.documentElement;
    function setFont(){
        var clientWidth = window.innerWidth || docEl.clientWidth;
        if (clientWidth > 640) {
            docEl.style.fontSize = '100px';
        }else{
            docEl.style.fontSize  = 100*(clientWidth/640)+'px'
        }
    }
    window.onresize = setFont;
    doc.addEventListener('DOMContentLoaded',setFont,false);
    
})(document,window)